package com.lanou3g.dllo.baidumusic.musiclibrary.ranklist;

import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;

/**
 * Created by dllo on 16/6/20.
 */
public class RanklistSingleQueue {

    private static RanklistSingleQueue ranklistSingleQueue;
    private RequestQueue requestQueue;
    private ImageLoader imageLoader;

    public RequestQueue getRequestQueue() {
        return requestQueue;
    }

    public ImageLoader getImageLoader() {
        return imageLoader;
    }

    private RanklistSingleQueue(Context context) {
        requestQueue = Volley.newRequestQueue(context);
        imageLoader = new ImageLoader(requestQueue, new RanklistMemoryCache());


    }

    public static RanklistSingleQueue getRanklistSingleQueue(Context context) {
        if (ranklistSingleQueue == null) {
            synchronized (RanklistSingleQueue.class) {
                if (ranklistSingleQueue == null) {
                    ranklistSingleQueue = new RanklistSingleQueue(context);
                }
            }
        }

        return ranklistSingleQueue;
    }

}
